package com.smh.a02IOStreamDemo2;

import java.io.FileReader;
import java.io.IOException;

public class CharSetDemo5 {

    public static void main(String[] args) throws IOException {

        FileReader fr = new FileReader("day26-code\\file\\a.txt");

        char[] chars = new char[2];
        int len;
        //\r和\n也是占用一个字符
        while ((len = fr.read(chars)) > 0) {
            System.out.println(new String(chars, 0, len));
        }

        fr.close();


    }
}
